Uec3.QueryBalanceWindow = Ext.extend(Ext.app.Module,{
	id: 'queryBalance',
   /*
    * Initialize this module.
    * This function is called at startup (page load/refresh).
    */
   init : function(initParams){
   
   },
  
   getComponent:function(){
   	   
   		var label = new Ext.form.DisplayField({
                fieldLabel:'您的账户余额',
                style: {font:'bold 18px arial,serif',margin: '20px 110px'}              
        });
   		  	
        Ext.Ajax.request({		            
	    	url:Uec3.App.Constants.homeUrl+"/company/queryBalance.do",
			method :"post",					   			
			timeout:360000,
			callback :function(options,success,response){
                var resp = Ext.decode(response.responseText);
                if(success){
                	label.setValue('您的账户余额     : '+resp.balance);
                }else{
                	Ext.MessageBox.alert("提示",'您的账户余额   : '+resp.msg);
                    label.setValue("查询账户余额失败...");
                }
            },
            success:function(response,options){
            	   	 
            },
            failure:function(response,options){
				Ext.MessageBox.alert("提示","查询账户余额失败......");
            }
		}); 
        
   		return label;
   },
   
   /**
	* Create this modules window here.
	*/
   createWindow : function(){
    	var desktop = this.app.getDesktop();
        var win = desktop.getWindow('balanceQuery');
        if (!win) {
			win = desktop.createWindow({
				        id : "balanceQuery",
						title : '余额查询',
						width : 500,
						height : 100,
						iconCls : 'acc-icon',
					    minWidth:1000,
						maximizable : false,
						resizable:false,
						maximized:false,
						//autoScroll : true,
						constrainHeader : true,
						taskbuttonTooltip : "余额查询",
						layout : "fit",
						items : [this.getComponent()]
					});
		}		
    	win.show();         
   }
});